package cn.com.darly.vpm.root;


import cn.com.darly.vpm.framework.base.ApplicationContextHolder;
import cn.com.darly.vpm.framework.base.BaseController;
import com.alibaba.dubbo.common.logger.Level;
import com.alibaba.dubbo.common.logger.LoggerFactory;

/**
 * Author : ZhangYuHui
 * Date : 2017/11/13
 * TODO :
 */
public class ApplicationVPM extends ApplicationContextHolder {

    /**
     * #项目名称
     */
    private static String applicationName;
    /**
     * #静态文件路径参数
     */
    private static String resourceUrl;

    private static String host;

    private static String liveTime;





    public ApplicationVPM() {
        super();
//        LoggerFactory.setLevel(Level.OFF);
        applicationName = ApplicationProperties.getValue("producer-application-name", "系统");
        resourceUrl = ApplicationProperties.getValue("producer-application-url", "http://localhost");
        liveTime =  ApplicationProperties.getValue("producer-application-time", "5");
        host =  ApplicationProperties.getValue("producer-application-rtmp", "http://localhost");
        log.info("********************************************");
        log.info("[系统<" + applicationName + ">启动完成]            *");
        log.info("********************************************");
        //设置系统参数
        showinfo.notifyApplicationName(applicationName);
        showinfo.initResource(resourceUrl);
        showinfo.initRtmp(host);
        BaseController.refreshPar();
    }

    public static String getApplicationName() {
        return applicationName;
    }

    public static String getResourceUrl() {
        return resourceUrl;
    }


    public static String getLiveTime() {
        return liveTime;
    }
}
